package com.pdf;

import com.itextpdf.text.pdf.PdfReader;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @User xiangyl
 * @Data 2020/11/14
 */
public class MyPdfReader {

    public static void main(String[] args) {
        String srcFile="D:\\test\\storage.pdf";
        String targetFile="D:\\test\\pdfContent.txt";
        String pageContent=null;
        PrintWriter printWriter=null;
        try {
            PdfReader pdfReader = new PdfReader(srcFile);
            printWriter = new PrintWriter(new FileOutputStream(targetFile));

        }catch (IOException e) {
            e.printStackTrace();
        }
        finally {
            printWriter.flush();
            printWriter.close();
        }
    }
}
